<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">{{msg}}</div>
  <script>
    const vm = new Vue({
      el: "#app", // 挂载
      data: {
        msg: "lisi"
      },
      beforeMount() {
        console.log("挂载之前");
        // 挂载之前DOM里面的变量没有进行赋值操作
        console.log(this.$el.innerHTML);
      },
      mounted() {
        console.log("挂载之后");
        // 挂载之后可以获取到DOM里面的实际内容
        console.log(this.$el.innerHTML);
      }
    })
  </script>
</body>

</html>